package org.idea.qiyu.framework.web.model;


import java.io.Serializable;

/**
 * @Author linhao
 * @Date created in 12:01 下午 2021/8/31
 */
public class WebJsonBean<T> implements Serializable {
    private static final long serialVersionUID = 4797015514072689420L;

    private int code;
    private String msg;
    private T data;

    public WebJsonBean() {
    }

    public WebJsonBean(int code, String msg, T data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static  <T> WebJsonBean<T> success() {
        return success(null);
    }

    public static  <T> WebJsonBean<T> success(T data) {
        return new WebJsonBean(0,"success", data);
    }


    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
